import request from "@/utils/request";
import { RecycleQueryParams } from "./recycle-request";

//申请回收API
const REQUEST_MANAGER_BASE_URL = "/api/v1/request-manager";

const RequestManagerAPI = {
  /**
   * （机构）查询分页数据
   */
  getRecycleRequestPageOrg(data?: RecycleQueryParams) {
    return request({
      url: `${REQUEST_MANAGER_BASE_URL}/page/org`,
      method: "post",
      data: data,
    });
  },

  /**
   * （机构）隶属本机构的配送人员
   */
  getOrgWorkers() {
    return request({
      url: `${REQUEST_MANAGER_BASE_URL}/org/workers`,
      method: "get",
    });
  },

  /**
   * 机构审核回收请求
   */
  auditRecycleRequest(data?: auditRequestDTO) {
    return request({
      url: `${REQUEST_MANAGER_BASE_URL}/audit`,
      method: "post",
      data: data,
    });
  },
};
export interface auditRequestDTO {
  requestId?: string;
  auditStatus?: string;
  courierId?: string;
  operatorId: string;
  rejectReason: string;
}
export default RequestManagerAPI;
